package com.zr.lads.pojo;
// Generated 2016-10-26 11:45:42 by Hibernate Tools 4.0.0.Final

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Site generated by hbm2java
 */
@Entity
@Table(name = "site", catalog = "lads")
public class Site implements java.io.Serializable {

	private Integer siteId;
	private String siteName;
	private String prevSite;
	private String nextSite;
	private Set<Range> ranges = new HashSet<Range>(0);
	private Set<SitePrice> sitePrices = new HashSet<SitePrice>(0);

	public Site() {
	}

	public Site(String siteName, String prevSite, String nextSite, Set ranges, Set sitePrices) {
		this.siteName = siteName;
		this.prevSite = prevSite;
		this.nextSite = nextSite;
		this.ranges = ranges;
		this.sitePrices = sitePrices;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "site_id", unique = true, nullable = false)
	public Integer getSiteId() {
		return this.siteId;
	}

	public void setSiteId(Integer siteId) {
		this.siteId = siteId;
	}

	@Column(name = "site_name", length = 32)
	public String getSiteName() {
		return this.siteName;
	}

	public void setSiteName(String siteName) {
		this.siteName = siteName;
	}

	@Column(name = "prevSite", length = 32)
	public String getPrevSite() {
		return this.prevSite;
	}

	public void setPrevSite(String prevSite) {
		this.prevSite = prevSite;
	}

	@Column(name = "nextSite", length = 32)
	public String getNextSite() {
		return this.nextSite;
	}

	public void setNextSite(String nextSite) {
		this.nextSite = nextSite;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "site")
	public Set<Range> getRanges() {
		return ranges;
	}

	public void setRanges(Set<Range> ranges) {
		this.ranges = ranges;
	}
	
	@OneToMany(fetch = FetchType.LAZY, mappedBy = "site",cascade = CascadeType.REMOVE)
	public Set<SitePrice> getSitePrices() {
		return sitePrices;
	}

	public void setSitePrices(Set<SitePrice> sitePrices) {
		this.sitePrices = sitePrices;
	}


}
